package sample.client.event;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import sample.client.event.SetupEvent.SetupEventHandler;

public class SetupEvent extends GwtEvent<SetupEventHandler>
{
  public static Type<SetupEventHandler> TYPE = new Type<SetupEventHandler>();

  public enum State {
    VALID, INVALID
  }

  private State setupStateIs;

  public SetupEvent(State s) {
    setupStateIs = s;
  }

  public State getSetupState() {
    return setupStateIs;
  }

  @Override
  public Type<SetupEventHandler> getAssociatedType() {
    return TYPE;
  }

  @Override
  protected void dispatch(SetupEventHandler handler) {
    handler.onSetupSave(this);
  }

  public interface SetupEventHandler extends EventHandler
  {
    public void onSetupSave(SetupEvent e);
  }
}
